﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.ComponentModel;

namespace Smugmug.Tests
{
    [XmlRoot("WebRequests")]
    public class WebRequestCollection : List<WebRequest> { }

    public class WebRequest
    {
        private string response;

        public string Url { get; set; }
        public string Response
        {
            get { return CleanString(response); }
            set { response = value; }
        }
        public string Method { get; set; }
        public string Error { get; set; }
        [DefaultValue(0)]
        public int ErrorCode { get; set; }

        private string CleanString(String s)
        {
            if (String.IsNullOrEmpty(s))
                return s;
            return s.Replace(Environment.NewLine, "").Replace("\n", "").Trim();
        }
    }
}
